package com.scheduledtest.demo.impl;

import com.scheduledtest.demo.ScheduledTaskJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.SimpleFormatter;

@Slf4j
@Service("ScheduledTaskJobImpl")
public class ScheduledTaskJobImpl implements ScheduledTaskJob {
    @Override
    public void run() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = new Date();
        log.info("ScheduledTask => 当前线程名称 {} >>{}", Thread.currentThread().getName(), simpleDateFormat.format(date));
    }
}
